home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / MDIDLG.PAK / CLIENT.CPP < prev    next >
C/C++ Source or Header  |  1997-05-06  |  2KB  |  97 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // Copyright (c) 1995, 1995 by Borland International, All Rights Reserved
  4. //
  5. // Filename:    client.cpp
  6. //
  7. // Date:        27-Apr-95
  8. //
  9. // Description:
  10. //----------------------------------------------------------------------------
  11. #include <owl/pch.h>
  12. #include "Test.h"
  13. #include "MdiDlg.h"
  14.  
  15. //
  16. // TestClient constructor
  17. //
  18. TTestClient::TTestClient(TModule* module)
  19. :
  20.   TMDIClient(module)
  21. {
  22.   TMenu contextMenu(*GetApplication(), IDM_MDIMENU);
  23.   TMenu subMenu(contextMenu.GetSubMenu(0));
  24.   AssignContextMenu(new TPopupMenu(subMenu));
  25. }
  26.  
  27.  
  28. //
  29. // TestClient destructor
  30. //
  31. TTestClient::~TTestClient()
  32. {
  33. }
  34.  
  35.  
  36. //
  37. // SetupWindow
  38. //
  39. void
  40. TTestClient::SetupWindow()
  41. {
  42.   TMdiClient::SetupWindow();
  43.   // put new stuff here
  44.   //
  45.   SETUP_HELPCONTEXT(TTestApp, TTestClient);
  46. }
  47.  
  48.  
  49. //
  50. // CleanupWindow
  51. //
  52. void
  53. TTestClient::CleanupWindow()
  54. {
  55.   // put new stuff here
  56.   //
  57.   CLEANUP_HELPCONTEXT(TTestApp, TTestClient);
  58.  
  59.   TMdiClient::CleanupWindow();
  60. }
  61.  
  62.  
  63. //
  64. // Response table for TestClient
  65. //
  66. DEFINE_RESPONSE_TABLE1(TTestClient, TMdiClient)
  67.   EV_COMMAND(CM_CREATECHILD, CmCreateChild),
  68. END_RESPONSE_TABLE;
  69.  
  70. DEFINE_HELPCONTEXT(TTestClient)
  71.   HCENTRY_MENU(IDH_CM_CREATECHILD,      CM_CREATECHILD),
  72.   HCENTRY_MENU(IDH_CM_CASCADECHILDREN,  CM_CASCADECHILDREN),
  73.   HCENTRY_MENU(IDH_CM_TILECHILDREN,     CM_TILECHILDREN),
  74.   HCENTRY_MENU(IDH_CM_ARRANGEICONS,     CM_ARRANGEICONS),
  75.   HCENTRY_MENU(IDH_CM_CLOSECHILDREN,    CM_CLOSECHILDREN),
  76.   HCENTRY_MENU(IDH_CM_ABOUTDLG,         CM_ABOUT),
  77. END_HELPCONTEXT;
  78.  
  79.  
  80. //
  81. // Create a child
  82. //
  83. void
  84. TTestClient::CmCreateChild()
  85. {
  86.   static bool TestDialog = false;
  87.   TestDialog = !TestDialog;
  88.   TMdiChild* child;
  89.   if (TestDialog)
  90.     child = new TMdiChild(*this, "Test Dialog", new TMdiDialog(0, IDD_MDIDIALOG));
  91.   else
  92.     child = new TMdiChild(*this, "MDI About Dialog", new TAboutDialog(0, IDD_ABOUT));
  93.   child->Create();
  94. }
  95.  
  96.  
  97.